home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15360 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: user2.mnsinc.com!huang
  2. From: huang@mnsinc.com (Szu-Wen Huang)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: big endian, little endian
  5. Date: 18 Apr 1996 17:39:13 GMT
  6. Organization: Monumental Network Systems
  7. Message-ID: <4l5uo1$79p@news1.mnsinc.com>
  8. References: <4ku9dm$t1t@news.ycc.yale.edu> <3172C1E9.3E95@willows.com> <4l5n36$qk8@hsun27.chevron.com>
  9. NNTP-Posting-Host: user.mnsinc.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. C.W.Racer (gacwra@hsun13.hou281.chevron.com) wrote:
  13. : In article <3172C1E9.3E95@willows.com>, Tarang Deshpande <tarang@willows.com> writes:
  14. : |> Actually it has nothing to with signed/unsigned integer rather it has to
  15. : |> do with how integers are represented in memory on different platforms.
  16. : |> In the representation of a two byte integer the question becomes is the
  17. : |> high byte or the low byte at the lower or higher address.  If the 
  18. : |> low byte is at the lower address then it uses little endian whereas if
  19. : |> the high byte is at the lower address then it used big endian.
  20.  
  21. : |> So the number 256 which is 0000000100000000 in binary can be thought off
  22. : |> as 00000001 * 256 + 00000000 where the 00000001 is the high byte and
  23. : |> 00000000 is the low byte.  On a little endian platform memory would look
  24. : |> like 0000000000000001 whereas on a big endian platform memory would look
  25. : |> like 0000000100000000.  
  26.  
  27. : Actually the representation is the same, only the byte numbering is 
  28. : different.
  29.  
  30. No, the difference between little/big endian byte ordering is as Tarang
  31. described, a matter of whether more significant digits are stored in
  32. higher memory (little endian) or the reverse.  This is not "byte
  33. numbering", whatever that is ;).  Representation is another thing
  34. altogether.  That would refer to how a number or an English letter or
  35. anything else is mapped to binary numbers.
  36.